#ifndef HANDLERS_H
#define HANDLERS_H


/*
 *  * Here are our signal handlers, I only
 *   * implemented SIGSEGV and SIGINT
 *    */

void segFault()
{
	printf("*** Fatal: Segmentation fault! ***\n");
	printf("Viper has crashed! This is most likely due to a VM bug\n");
        printf("not a programming bug, if you see GruntTheDivine tell\nhim this.\n\n");
	char **strings;
	void *array[10];
	/*
 * 	size_t size = backtrace(array, 10);
 * 		strings = backtrace_symbols(array,size);
 * 			int i = 0;
 * 				for(i; i < size;i++)
 * 						printf("%s\n",strings[i]);
 * 							*/
	abort();
}

void sigInt()
{
	printf("\nProgram has been terminated!\n");
	abort();
}
void sigInit()
{
	signal(SIGSEGV,segFault);
	signal(SIGINT,sigInt);
}


#endif

